# Copyright 2003 Brian Gerkey
# Distributed under the terms of the GNU General Public License v2
# $Header: /cvsroot/playerstage/code/packages/gentoo/player-1.6.ebuild,v 1.6 2005/01/22 00:38:03 ceyusa Exp $

DESCRIPTION="One hell of a robot device server"
SRC_URI="mirror://sourceforge/playerstage/player-1.6.tar.gz"
HOMEPAGE="http://playerstage.sourceforge.net"
S="${WORKDIR}/player-1.6"

KEYWORDS="x86"
SLOT="0"
LICENSE="GPL-2"
IUSE="python gazebo"

DEPEND="=dev-libs/librtk-2.3.0
        >=sci-libs/gsl-1.3
        python? ( >=dev-lang/python-2.2 )
        gazebo? ( >=sci-misc/gazebo-0.5)
        >=sys-apps/sed-4"

src_compile() {
	sed -i 's#$(prefix)/src/player#$(datadir)/player#g' ${S}/examples/plugins/exampledriver/Makefile.am
	sed -i 's#$(prefix)/src/player#$(datadir)/player#g' ${S}/examples/plugins/multidriver/Makefile.am

	econf \
        `use_enable python libplayerc-py` \
        `use_enable gazebo` \
		--enable-rflex \
		--enable-vfh \
		--enable-iwspy \
		--enable-amcl \
		--enable-microstrain \
		--enable-waveaudio \
		--enable-reb \
		|| die 
	emake || die 
}

src_install() {
	einstall || die
	insinto /usr/include/player
	doins ${S}/server/error.h
	dodoc AUTHORS ChangeLog
	docinto examples
}
